{if $action == 'my'}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset={DT_CHARSET}"/>
	<title>{if $head_title}{$head_title}{$DT[seo_delimiter]}{/if}{$DT[sitename]}</title>
	<link rel="stylesheet" type="text/css" href="image/style.css"/>
	<script type="text/javascript" src="{SITE_URL}lang/{DT_LANG}/lang.js"></script>
	<script type="text/javascript" src="{SITE_URL}file/script/config.js"></script>
	<script type="text/javascript" src="{SITE_URL}file/script/common.js"></script>
	<script type="text/javascript" src="{SITE_URL}file/script/admin.js"></script>
</head>
<body>
<div id="friend" style="background:#EBF0F6;">
	{if $lists}
		<table cellpadding="3" cellspacing="3" width="100%">
			{loop $lists $k $v}
				{if $k%5==0}
				<tr>{/if}
				<td title="{$v[company]}{if $v[note]}({$v[note]}){/if}" width="20%"><a href="javascript:send('{if $from=='sms'}{$v[mobile]}{else}{$v[username]}{/if}');" class="t"><span style="">{if $v[truename]}{$v[truename]}{else}{$v[username]}{/if}</span></a></td>
				{if $k%5==4}</tr>{/if}
			{/loop}
		</table>
		<div class="pages">{$pages}</div>
		{else}
		<p style="padding:10px;"><a href="friend.php?action=add" class="t" target="_top">您还没有添加好友...点这里添加</a></p>
	{/if}
</div>
<script type="text/javascript">
	try{parent.Dd('dload').style.display='none';parent.Dd('diframe').style.height = Dd('friend').scrollHeight+'px';} catch (e){}
</script>
</body>
</html>
{else}
{template 'header', $module}
<div class="main-block bd-gray mt10">
	<div class="hd fn-clear">
	    <h2 class="fn-left">我的好友</h2>
	</div>
	<ul id="data-nav" class="main-nav mt10 fn-clear">
	    <li id="status_1"><a href="{url('member/friend')}?action=add&status=1">添加好友</a></li>
	    <li id="status_3"><a href="{url('member/friend')}?status=3">我的好友</a></li>
	    <li id="status_2"><a href="{url('member/type')}?item=friend&status=2">好友分类</a></li>
	</ul>
	{if $action == 'add'}
	<form method="post" action="friend.php" id="pub-form">
		<input type="hidden" name="action" value="{$action}"/>
		<table cellpadding="5" cellspacing="1"class="data-form mt10 c000 con layout960" >
			<tr >
				<th width="90">分类：</th>
				<td>{$type_select}&nbsp; <a href="type.php?item=friend" class="t">[管理分类]</a></td>
			</tr>
			<tr>
				<th width="90"><span class="cred">*</span> 姓 名：</th>
				<td><input type="text" size="20" name="post[truename]" class="graybd-ipt easyui-validatebox" data-options="required:true,validType:'length[1,50]',missingMessage:'请填写姓名'"  value="{$truename}"/> <span id="dtruename" class="cred"></span></td>
			</tr>
			<tr>
				<th width="90">会员名：</th>
				<td>
                    <input type="text" size="20" name="post[username]" class="fn-left mr10" id="username" value="{$username}"/>
			</tr>
			<tr>
				<th width="90">企业名称：</th>
				<td><input type="text" size="40" name="post[company]" id="company" value="{$company}"/></td>
			</tr>
			<tr>
				<th width="90">职位：</th>
				<td><input type="text" size="20" name="post[career]" id="career" value="{$career}"/></td>
			</tr>
			<tr>
				<th width="90">电话：</th>
				<td><input type="text" size="20" name="post[telephone]" id="telephone" value="{$telephone}"/></td>
			</tr>
			<tr>
				<th width="90">手机：</th>
				<td><input type="text" size="20" name="post[mobile]" id="mobile"/></td>
			</tr>
			<tr>
				<th width="90">主页：</th>
				<td><input type="text" size="40" name="post[homepage]" id="homepage" value="{$homepage}"/></td>
			</tr>
			<tr>
				<th width="90">Email：</th>
				<td><input type="text" size="30" name="post[email]" id="email"/></td>
			</tr>
			{if $DT[im_qq]}
				<tr>
					<th width="90">QQ：</th>
					<td><input type="text" size="20" name="post[qq]" id="qq" value="{$qq}"/></td>
				</tr>
			{/if}
			{if $DT[im_ali]}
				<tr>
					<th width="90">阿里旺旺：</th>
					<td><input type="text" size="20" name="post[ali]" id="ali" value="{$ali}"/></td>
				</tr>
			{/if}
			{if $DT[im_msn]}
				<tr>
					<th width="90">MSN：</th>
					<td><input type="text" size="30" name="post[msn]" id="msn" value="{$msn}"/></td>
				</tr>
			{/if}
			{if $DT[im_skype]}
				<tr>

					<th width="90">Skype：</th>
					<td><input type="text" size="20" name="post[skype]" id="skype" value="{$skype}"/></td>
				</tr>
			{/if}
			<tr>
				<th width="90">备注：</th>
				<td><input type="text" size="40" name="post[note]" id="note"/></td>
			</tr>
			<tr>
				<th>&nbsp;</th>
				<td><input type="submit" name="submit" value="确定" class="fn-left mr20 btn"/>
                    <input type="reset" name="reset" value="重置" class="btn"/></td>
			</tr>
		</table>
	</form>
		{elseif $action == 'edit'}
	<form method="post" action="friend.php" id="pub-form">
		<input type="hidden" name="action" value="{$action}"/>
		<input type="hidden" name="itemid" value="{$itemid}"/>
		<input type="hidden" name="forward" value="{$forward}"/>
		<table cellpadding="5" cellspacing="1" class="data-form mt10 c000 con layout960">
			<tr>
				<th width="90">分类：</th>
				<td>{$type_select}&nbsp; <a href="type.php?item=friend" class="t">[管理分类]</a></td>
			</tr>
			<tr>
				<th>显示顺序：</th>
				<td><input type="text" size="3" name="post[listorder]" id="listorder" value="{$listorder}"/> 请填写数字，数字越大越靠前</td>
			</tr>
			<tr>
				<th><span class="cred">*</span> 姓名：</th>
				<td><input type="text" size="20" name="post[truename]" class="graybd-ipt easyui-validatebox" data-options="required:true,validType:'length[1,50]',missingMessage:'请填写姓名'"  value="{$truename}"/> <span id="dtruename" class="cred"></span></td>
			</tr>
			<tr>
				<th>会员名：</th>
				<td><input type="text" size="20" name="post[username]" id="username" value="{$username}"/></td>
			</tr>
			<tr>
				<th>企业名称：</th>
				<td><input type="text" size="40" name="post[company]" id="company" value="{$company}"/></td>
			</tr>
			<tr>
				<th>职位：</th>
				<td><input type="text" size="20" name="post[career]" id="career" value="{$career}"/></td>
			</tr>
			<tr>
				<th>电话：</th>
				<td><input type="text" size="20" name="post[telephone]" id="telephone" value="{$telephone}"/></td>
			</tr>
			<tr>
				<th>手机：</th>
				<td><input type="text" size="20" name="post[mobile]" id="mobile" value="{$mobile}"/></td>
			</tr>
			<tr>
				<th>主页：</th>
				<td><input type="text" size="40" name="post[homepage]" id="homepage" value="{$homepage}"/></td>
			</tr>
			<tr>
				<th>Email：</th>
				<td><input type="text" size="30" name="post[email]" id="email" value="{$email}"/></td>
			</tr>
			{if $DT[im_qq]}
				<tr>
					<th>QQ：</th>
					<td><input type="text" size="20" name="post[qq]" id="qq" value="{$qq}"/></td>
				</tr>
			{/if}
			{if $DT[im_ali]}
				<tr>
					<th>阿里旺旺：</th>
					<td><input type="text" size="20" name="post[ali]" id="ali" value="{$ali}"/></td>
				</tr>
			{/if}
			{if $DT[im_msn]}
				<tr>
					<th>MSN：</th>
					<td><input type="text" size="30" name="post[msn]" id="msn" value="{$msn}"/></td>
				</tr>
			{/if}
			{if $DT[im_skype]}
				<tr>
					<th>Skype：</th>
					<td><input type="text" size="20" name="post[skype]" id="skype" value="{$skype}"/></td>
				</tr>
			{/if}
			<tr>
				<th>备注：</th>
				<td><input type="text" size="40" name="post[note]" id="note" value="{$note}"/></td>
			</tr>
			<tr>
				<th>&nbsp;</th>
				<td>
                    <input type="submit" name="submit" value="修改" class="btn"/>
                    <input type="button" value=" 返 回 " class="btn" onclick="history.back(-1);"/>
                </td>
			</tr>
		</table>
	</form>
	{else}
	<form action="friend.php">
		<div class="filter con fn-clear">
			<p class="fn-left mr10">{$fields_select}</p>
			<input class="fn-left mr10" type="text" size="50" name="kw" value="{$kw}" title="关键词"/>
            <p class="fn-left mr10">{$type_select}</p>
			<button type="submit" class="fn-left mr10 btn">搜索</button>
			<button type="button" class="btn" onclick="window.location='friend.php';">重置</button>
		</div>
	</form>
	<table class="con">
		{loop $lists $k $v}
			{if $k%2==0}
			<tr>{/if}
			<td class="friend-list" valign="top" width="50%" bgcolor="#FFFFFF" onmouseover="this.style.backgroundColor='#F2F6FB';" onmouseout="this.style.backgroundColor='#FFFFFF';" title="{$v[note]}">
				{if $v}
					<table width="96%" align="center">
						<tr>
							<td><strong style="color:#444444;">{$v[dcompany]}</strong></td>
						</tr>
						<tr>
							<td>{$v[truename]}{if $v[career]} ({$v[career]}){/if}</td>
						</tr>
						<tr>
							<td>电话：{$v[telephone]}</td>
						</tr>
						<tr>
							<td>手机：{$v[mobile]}</td>
						</tr>
						<tr>
							<td>
                                <span class="fn-right" title="添加时间 {$v[adddate]}">
                                <a href="friend.php?typeid={$v[typeid]}" class="t">[{$v[type]}]</a>&nbsp;
                                <a href="friend.php?action=edit&itemid={$v[itemid]}" class="t">[修改]</a>&nbsp;
                                <a href="friend.php?action=delete&itemid={$v[itemid]}" onclick="return confirm('确定要删除吗？此操作将不可撤销');" class="t">[删除]</a>&nbsp;
                                </span>

								{if $DT[sms] && $v[mobile]}<a href="sms.php?action=add&mob={$v[mobile]}"><img width="16" height="16" src="{CSSIMG_URL}/common/mobile.gif" title="发送短信" align="absmiddle"/></a>&nbsp;{/if}
								{if $v[username]}<a href="message.php?action=send&touser={$v[username]}"><img width="16" height="16" src="{CSSIMG_URL}/common/msg.gif" title="发送站内信" alt="" align="absmiddle"/></a>&nbsp;{/if}
								{if $v[email]}<a href="sendmail.php?email={$v[email]}"><img width="16" height="16" src="{CSSIMG_URL}/common/email.gif" title="发送Email {$v[email]}" alt="" align="absmiddle"/></a>&nbsp;{/if}
								{if $v[username] && $DT[im_web]}{Im::web($v[username])}&nbsp;{/if}
								{if $v[qq] && $DT[im_qq]}{Im::qq($v[qq])}&nbsp;{/if}
								{if $v[ali] && $DT[im_ali]}{Im::ali($v[ali])}&nbsp;{/if}
								{if $v[msn] && $DT[im_msn]}{Im::msn($v[msn])}&nbsp;{/if}
								{if $v[skype] && $DT[im_skype]}{Im::skype($v[skype])}&nbsp;{/if}
							</td>
						</tr>
					</table>
					{else}
					&nbsp;
				{/if}
			</td>
			{if $k%2==1}</tr>{/if}
		{/loop}
	</table>
		{if $MG[friend_limit]}
		<div class="con">好友上限 <span class="f_b cred">{$MG[friend_limit]}</span> 人&nbsp;&nbsp;&nbsp;当前已加 <span class="f_b">{$limit_used}</span> 人&nbsp;&nbsp;&nbsp;还可以加 <span class="f_b f_blue">{$limit_free}</span> 人</div>
		{/if}
	<div class="pages">{$pages}</div>
    </div>
	{/if}
	{if $action=='add' || $action=='edit'}
	<script type="text/javascript">
				seajs.use(['member'], function(member){
					$("#pub-form").submit(function(){
						return $(this).form('validate');
					});
				})
	</script>
	{/if}
    <script type="text/javascript">
        seajs.use(['member'], function(member){
            member.active('menu_general', 'friend', 'status_{if $status}{$status}{else}3{/if}')
        })
       </script>
</div>
	{template 'footer', $module}
{/if}